#!/usr/bin/python

# Author: Sergey Vartanov (me@enzet.ru)

import sys

first = open(sys.argv[1], 'r')

output = sys.argv[2]
noinoutput = sys.argv[3]

found = 0
foundno = 0

if output == "":
	found = 1

line = first.readline()
while line != "":
	if line.find(output) != -1:
		found = 1
	if line.find(noinoutput) != -1 or line.find("Error") != -1 or line.find("Exception") != -1:
		foundno = 1
	line = first.readline()

if not found or foundno:
  print("            \033[0;31mException\033[0m")
